<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
	<base href="<%=basePath%>">
	<!-- jsp文件头和头部 -->
	<%@ include file="../../system/admin/top.jsp"%> 
	</head> 
	
<body>
		
<div class="container-fluid" id="zhongxin">


<div id="page-content" class="clearfix" style="padding-left:10px;">
						
  <div class="row-fluid">


	<div class="row-fluid">
	
			<!-- 检索  -->
			<form action="ck/list2.do" method="post" name="drugForm1" id="drugForm1">
			<table>
				<tr>
					<td>
						<span class="input-icon">
							<input autocomplete="off" id="gjz" type="text" name="gjz"  placeholder="这里检索需出库的药品" style="width: 200px;"/>
							<i id="nav-search-icon" class="icon-search"></i>
						</span>
					</td>					
					<td style="vertical-align:top;"><button class="btn btn-mini btn-light" onclick="search();" title="检索"><i id="nav-search-icon" class="icon-search"></i></button></td>
					<td>
						<span>药品出库数量：</span>
						<span class="">
							<input onkeyup="value=value.replace(/[^\d.]/g,'')" autocomplete="off" type="text" name="rksl"  id="rksl" placeholder="这里输入药品出库数量" style="width: 200px;"/>
						</span>
					</td>
					<td style="vertical-align:top;"><a class="btn btn-mini btn-success" onclick="sub();" title="确定出库" style="padding:2px 5px;">确定出库</a></td>
				</tr>
			</table>
			<!-- 检索  -->
		
		
			<table id="table_report" class="table table-striped table-bordered table-hover">
				
				<thead>
					<tr>
						<th class="center"  hidden="hidden">
						<label><input type="checkbox" id="zcheckbox" /><span class="lbl"></span></label>
						</th>
						<th hidden="hidden" >id</th>
						<th>药品编号</th>
						<th>药品名称</th>
						<th>药品类型</th>
						<th>药品单位</th>
						<th>药品单价(元)</th>
						<th>药品用法</th>
						<th>库存数</th>
						<!-- <th class="center">操作</th> -->
					</tr>
				</thead>
										
				<tbody>
					
				<!-- 开始循环 -->	
				<c:choose>
					<c:when test="${not empty listAll}">
					<c:if test="${QX.cha == 1 }">
						<c:forEach items="${listAll}" var="drug" varStatus="vs">
									
							<tr>
								<td class='center' style="width: 30px;"  hidden="hidden">
									<label><input type='checkbox' name='ids' id="" value="${drug.id}"/><span class="lbl"></span></label>
								</td>
								<td hidden="hidden" id="ypid">${drug.id}</td>
								<td>${drug.ypcode}</td>
								<td>${drug.ypname}</td>
								<td>${drug.yptype}</td>
								<td>${drug.ypunit}</td>
								<td>${drug.price}</td>
								<td>${drug.ypusage}</td>
								<td>${drug.kczh}</td>
								<%-- <td style="width: 60px;">
									<div class='hidden-phone visible-desktop btn-group'>
										<a class='btn btn-mini btn-danger' title="删除" onclick="del('${drug.id}');"><i class='icon-trash'></i></a>			
									</div>
								</td> --%>
							</tr>
						
						</c:forEach>
						</c:if>
						
						<c:if test="${QX.cha == 0 }">
							<tr>
								<td colspan="10" class="center">您无权查看</td>
							</tr>
						</c:if>
					</c:when>
					<c:otherwise>
						<tr class="main_info">
							<td colspan="10" class="center">没有相关数据</td>
						</tr>
					</c:otherwise>
				</c:choose>
					
				
				</tbody>
			</table>
			
		<div class="page-header position-relative">
		<table style="width:100%;">
			<tr>
				<td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
			</tr>
		</table>
		</div>
		</form>
	</div>
 
 
 
 
	<!-- PAGE CONTENT ENDS HERE -->
  </div><!--/row-->
	
</div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->
		
		<!-- 返回顶部  -->
		<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
			<i class="icon-double-angle-up icon-only"></i>
		</a>
		
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
		<!-- 引入 -->
		
		
		<script type="text/javascript" src="static/js/jquery.tips.js"></script><!--提示框-->
		<script type="text/javascript">
		
		$(top.hangge());
		//检索
		function search(){
			top.jzts();
			$("#drugForm1").submit();
		}
			
		
		function sub(){
			var length = '${listAll.size()}';			
			if(length == "1"){
				if($("#rksl").val()==""){
					$("#rksl").focus();
					return false;
				}	
				var ypid = document.getElementById('ypid').innerHTML;
				var url = "ck/add.do?id="+ypid;   
			    $("#drugForm1").attr("action", url);  
			    $("#drugForm1").submit();
			}else{
				alert("请保留一条药品信息，然后点击出库！");
				return false;
			}
		}
		
	
		</script>
		
		<script type="text/javascript">
		
		$(function() {
			
			//日期框
			$('.date-picker').datepicker();
			
			//下拉框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//复选框
			$('table th input:checkbox').on('click' , function(){
				var that = this;
				$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function(){
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});
					
			});
			
		});
	
		</script>
		
	</body>
</html>

